package com.ruoyi.zsyh.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.IdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Service;
import com.ruoyi.zsyh.mapper.ZsyhPartsQrcodeHistoryMapper;
import com.ruoyi.zsyh.domain.ZsyhPartsQrcodeHistory;
import com.ruoyi.zsyh.service.IZsyhPartsQrcodeHistoryService;
import com.ruoyi.common.core.text.Convert;

/**
 * 产品二维码申请记录Service业务层处理
 * 
 * @author yuexl
 * @date 2022-01-09
 */
@Service
public class ZsyhPartsQrcodeHistoryServiceImpl implements IZsyhPartsQrcodeHistoryService 
{
    @Autowired
    private ZsyhPartsQrcodeHistoryMapper zsyhPartsQrcodeHistoryMapper;

    /**
     * 查询产品二维码申请记录
     * 
     * @param id 产品二维码申请记录ID
     * @return 产品二维码申请记录
     */
    @Override
    public ZsyhPartsQrcodeHistory selectZsyhPartsQrcodeHistoryById(String id)
    {
        return zsyhPartsQrcodeHistoryMapper.selectZsyhPartsQrcodeHistoryById(id);
    }

    /**
     * 查询产品二维码申请记录列表
     * 
     * @param zsyhPartsQrcodeHistory 产品二维码申请记录
     * @return 产品二维码申请记录
     */
    @Override
    public List<ZsyhPartsQrcodeHistory> selectZsyhPartsQrcodeHistoryList(ZsyhPartsQrcodeHistory zsyhPartsQrcodeHistory)
    {
        return zsyhPartsQrcodeHistoryMapper.selectZsyhPartsQrcodeHistoryList(zsyhPartsQrcodeHistory);
    }

    /**
     * 新增产品二维码申请记录
     * 
     * @param zsyhPartsQrcodeHistory 产品二维码申请记录
     * @return 结果
     */
    @Override
    public int insertZsyhPartsQrcodeHistory(ZsyhPartsQrcodeHistory zsyhPartsQrcodeHistory)
    {
        zsyhPartsQrcodeHistory.setId(IdWorker.getId());
        zsyhPartsQrcodeHistory.setCreateTime(DateUtils.getNowDate());
        return zsyhPartsQrcodeHistoryMapper.insertZsyhPartsQrcodeHistory(zsyhPartsQrcodeHistory);
    }

    /**
     * 修改产品二维码申请记录
     * 
     * @param zsyhPartsQrcodeHistory 产品二维码申请记录
     * @return 结果
     */
    @Override
    public int updateZsyhPartsQrcodeHistory(ZsyhPartsQrcodeHistory zsyhPartsQrcodeHistory)
    {
        return zsyhPartsQrcodeHistoryMapper.updateZsyhPartsQrcodeHistory(zsyhPartsQrcodeHistory);
    }

    /**
     * 删除产品二维码申请记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteZsyhPartsQrcodeHistoryByIds(String ids)
    {
        return zsyhPartsQrcodeHistoryMapper.deleteZsyhPartsQrcodeHistoryByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除产品二维码申请记录信息
     * 
     * @param id 产品二维码申请记录ID
     * @return 结果
     */
    @Override
    public int deleteZsyhPartsQrcodeHistoryById(String id)
    {
        return zsyhPartsQrcodeHistoryMapper.deleteZsyhPartsQrcodeHistoryById(id);
    }

    public ZsyhPartsQrcodeHistory getQrCodeTrue(String qrcodeFirst, int qrcodeAfter){
        return zsyhPartsQrcodeHistoryMapper.getQrCodeTrue(qrcodeFirst, qrcodeAfter);
    }
}
